package cn.edu.just.firstjavaapp.l14.exception;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Date;

public class Main04 {
    public static void main(String[] args)  {
        try {
            f1();
        }catch (ArithmeticException e){
            System.out.println("在main里处理了异常");
        }

    }

    private static void f1()  {

        try {
            f2();
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
    }

    private static void f2() throws FileNotFoundException{

        try {
            f3();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }


    }

    private static void f3() throws FileNotFoundException, IOException {   //throws是方法签名的一部分

        FileInputStream fis = new FileInputStream("abc.txt");
        System.out.println("一切正常");


    }
}
